<% if (@deployment && @deployment.deploymentState != 'complete' && @platforms.present?) ||
       @environment.ciState == 'locked'  ||
       @environment.comments.present? %>
  if (window.stop_deployment_polling) {
    stop_deployment_polling();
  }
  $j("#overlay").html('<%= escape_javascript(render('deployment')) %>');
<% else %>
  window.location.reload();
<% end %>

